package com.hkts.reportform.utils;

import com.hkts.reportform.datastatics.entity.ReportForm;

import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Map;

/**
 * @ClassNameSortUtils
 * @Description
 * @Author yck
 * @Date2020-10-20 20:16
 * @Version V1.0
 **/
public class SortUtils {
    //排序
    public static List<ReportForm> sortLiet(List<ReportForm> list) {
        Collections.sort(list, new Comparator<ReportForm>() {
            @Override
            public int compare(ReportForm o1, ReportForm o2) {
                return -o1.getUsage().compareTo(o2.getUsage());
            }
        });

        List<ReportForm> reportForms = list.subList(0, 10);
        return reportForms;
    }
    //顺序反转
    public static List<Float> reverstList(List<Float> list) {
         Collections.reverse(list);


        return list;
    }
}
